package com.xiaojiezhu.shiro.spring.configuration;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.DelegatingFilterProxy;

/**
 * @Author 朱小杰
 * 时间 2017-08-06 .23:27
 * 说明 ...
 */
@Configuration
public class WebConfiguration {

    @Bean
    public FilterRegistrationBean shiroProxyFilter(){
        FilterRegistrationBean bean = new FilterRegistrationBean(new DelegatingFilterProxy());
        bean.addUrlPatterns("/**");
        bean.addInitParameter("targetBeanName","shiroFilter");
        return bean;
    }

}
